/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package economicocontrol.dao;

import economicocontrol.Constante.Constante;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author CyberOD
 */
public class ManagerDAO extends Exception{
    
     private static EntityManager getEntityManagerDAO() {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory(Constante.PERSISTENCE_UNIT);
        javax.persistence.EntityManager em = emf.createEntityManager();
        return em;
     }
     
    public EntityManager getEntityManager(){
        EntityManager em = getEntityManagerDAO();
        return em;
    }
}
